//
//  publicNodataView.m
//  ZJControlsClass
//
//  Created by wandoufo on 2024/12/17.
//

#import "publicNodataView.h"

@interface publicNodataView ()

@property (nonatomic,strong) UIImageView * iconImg;
@property (nonatomic,strong) UILabel * msgLabel;


@end




@implementation publicNodataView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        [self addSubview:self.iconImg];
        [self addSubview:self.msgLabel];
        
        [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.mas_centerX);
            make.centerY.equalTo(self.mas_centerY);
            make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(150), ALIGN_WIDTH_PT(150))));
        }];
        
        [self.msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.mas_centerX);
            make.top.equalTo(self.iconImg.mas_bottom).with.offset(ALIGN_HEIGHT_PT(10));
        }];
        
        
    }
    return self;
}


#pragma mark -- 懒加载
-(UIImageView *)iconImg{
    if (!_iconImg) {
        _iconImg = [UIImageView new];
        _iconImg.image = [UIImage imageNamed:@"空数据"];
    }
    return _iconImg;
}

-(UILabel *)msgLabel{
    if (!_msgLabel) {
        _msgLabel = [UILabel new];
        _msgLabel.textAlignment = NSTextAlignmentCenter;
        _msgLabel.font = FONT14;
        _msgLabel.text = @"暂无数据";
        _msgLabel.textColor = [UIColor blackColor];
    }
    return _msgLabel;
}

@end
